package com.ph.shopping.facade.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import cm.ph.shopping.facade.order.entity.PhOrderOnline;
import cm.ph.shopping.facade.order.vo.ProductNumAndIdVo;
import cm.ph.shopping.facade.order.vo.ProductVo;
import cm.ph.shopping.facade.order.vo.QueryOnLineOrderDetailVo;
import cm.ph.shopping.facade.order.vo.QueryOnLineOrderVo;
import cm.ph.shopping.facade.order.vo.QueryUserAddressVo;
import cm.ph.shopping.facade.order.vo.QueryWebOnLineOrderDetailVo;
import cm.ph.shopping.facade.order.vo.QueryWebOnLineOrderVo;

import com.ph.shopping.common.core.base.BaseMapper;

public interface IOrderOnlineMapper extends BaseMapper<PhOrderOnline> {
	// 更新上线订单状态
	public int updateOnLineOrder(@Param("orderNo") String orderNo, @Param("status") int status);

	// 更新线下订单状态
	public int updateUnLineOrder(@Param("orderNo") String orderNo, @Param("status") int status);

	// 查询后台订单列表
	public List<QueryOnLineOrderVo> listOnlineOrders(@Param("agentId") Long agentId,@Param("supplierId") Long supplierId,
			@Param("orderNo") String orderNo, @Param("roleCode") Integer roleCode) throws Exception;

	// 查询会员订单列表
	public List<QueryWebOnLineOrderVo> listWebOnLineOrders(@Param("memberId") long memberId,
			@Param("status") int status);

	// 会员订单详情
	public QueryWebOnLineOrderDetailVo getWebOnLineOrderDetail(@Param("orderId") long orderId,
			@Param("deliveryType") int deliveryType) throws Exception;

	// 获取供应商名称
	public String getSupplyerName(@Param("productId") long productId);

	// 会员订单后台详情
	public QueryOnLineOrderDetailVo getOnLineOrderDetail(@Param("orderId") long orderId);

	// 查询发货地址
	public List<QueryUserAddressVo> getSendAddress(@Param("userId") long userId);

	// 发货
	public int updateOrderToSend(@Param("status") int status,
			@Param("logisticName") String logisticName, @Param("logisticNo") String logisticNo,
			@Param("orderId") long orderId);

	// 查询商品信息
	public ProductVo getProduct(@Param("productId") long productId);

	public ProductNumAndIdVo getProductNum(@Param("orderNo") String orderNo);
}
